package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.BorrowLog;
import com.ruoyi.system.mapper.BorrowLogMapper;
import com.ruoyi.system.service.IBorrowLogService;
import com.ruoyi.system.service.IBrAuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 借还日志Service业务层处理
 * 
 * @author hzl
 * @date 2025-02-09
 */
@Service
public class BrAuditServiceImpl implements IBrAuditService
{
    @Autowired
    private BorrowLogMapper borrowLogMapper;

    /**
     * 查询借还日志
     * 
     * @param borrowLogId 借还日志主键
     * @return 借还日志
     */
    @Override
    public BorrowLog selectBorrowLogByBorrowLogId(Long borrowLogId)
    {
        return borrowLogMapper.selectBorrowLogByBorrowLogId(borrowLogId);
    }

    /**
     * 查询借还日志列表
     * 
     * @param borrowLog 借还日志
     * @return 借还日志
     */
    @Override
    public List<BorrowLog> selectBorrowLogList(BorrowLog borrowLog)
    {
        return borrowLogMapper.selectBorrowLogList(borrowLog);
    }

    /**
     * 新增借还日志
     * 
     * @param borrowLog 借还日志
     * @return 结果
     */
    @Override
    public int insertBorrowLog(BorrowLog borrowLog)
    {
        return borrowLogMapper.insertBorrowLog(borrowLog);
    }

    /**
     * 修改借还日志
     * 
     * @param borrowLog 借还日志
     * @return 结果
     */
    @Override
    public int updateBorrowLog(BorrowLog borrowLog)
    {
        return borrowLogMapper.updateBorrowLog(borrowLog);
    }

    /**
     * 批量删除借还日志
     * 
     * @param borrowLogIds 需要删除的借还日志主键
     * @return 结果
     */
    @Override
    public int deleteBorrowLogByBorrowLogIds(Long[] borrowLogIds)
    {
        return borrowLogMapper.deleteBorrowLogByBorrowLogIds(borrowLogIds);
    }

    /**
     * 删除借还日志信息
     * 
     * @param borrowLogId 借还日志主键
     * @return 结果
     */
    @Override
    public int deleteBorrowLogByBorrowLogId(Long borrowLogId)
    {
        return borrowLogMapper.deleteBorrowLogByBorrowLogId(borrowLogId);
    }

    @Override
    public BorrowLog getBorrowLogByAssetId(String assetId) {
        return borrowLogMapper.getBorrowLogByAssetId(assetId);
    }
}
